In SMPS (switch mode power supply) applications, the power supply designer needs to measure the average current flow in the power supply. FIGS. 1(a) and 1(b) show typical current waveforms for traditional (classic) SMPS topologies. The simplest designs use peak current sensing which is often implemented with an analog comparator. In this scenario, the average current flow is simply one-half of the peak current (Ipk) (FIG. 1(a)). For applications where the current does not reach zero (FIG. 1(b)), two measurements are required to calculate average current flow: Imin and Imax. This is often implemented using a microcontroller with an integral analog-to-digital converter (ADC). In many newer SMPS topologies with many transistors switching in and out circuit elements during the PWM cycle, the sensed current waveform may be very irregular (FIG. 1(c)). To calculate the average current value over a sample period is very difficult because the signal transitions are too fast for an Analog-to-Digital Converter (ADC) to follow. The current waveform shown in FIG. 1(c) is a representation for current in a power supply using advanced soft-switching techniques to improve efficiency. The only effective method to measure this current waveform is to implement a method to “integrate under the curve” to obtain the total average current per sample period. Referring to FIG. 2, signal waveform sample has been done using an operational amplifier to “integrate under the curve” but requires a high resistance value resistor R which is physically large in size, the integrated output from the operation amplifier is inverted, and a negative power supply rail is required for the operation amplifier.